Repository navigation
Conversation
Adds a `develop_personal_canvas` tool to the analyst agent. It runs a sub-agent with the canvas instructions that saves the dashboard as a personal canvas of the session's user through a new `write_personal_canvas` tool, which reports parse and reconcile errors back so the sub-agent can fix them. Personal canvases are stored by the admin service, so the runtime saves them through a new internal RPC, `SavePersonalFileForUser`. Only the project's deployment can call it, the owner must be a user with read access to the project, annotations in the YAML are dropped, and edits keep the canvas' sharing state. The tools need the `personal_canvases` feature flag and a user in the session, and `write_personal_canvas` is only available inside `develop_personal_canvas`.
Personal canvases are owned by the user rather than stored in the repo, so creating one doesn't need the edit access the other unforwarded tools require. The runtime still rejects calls for projects without the personal_canvases feature flag.
The org-level MCP server lists the same tools for every project, so a client only learns that a project lacks one when it calls it. Instead of passing on the runtime's "unknown tool" error, say why, and for develop_personal_canvas, that the project doesn't enable personal canvases.
- Read a personal canvas' parse status only after the project parser has pulled and parsed it. Waiting for idle while ignoring hidden resources returned before the (hidden) parser finished, so a broken canvas could be reported as saved. - Only the project's primary deployment can save personal files, since they live in the prod environment, and the tools are hidden outside prod. - Edits fail instead of overwriting a canvas the user shared, unshared or deleted while it was being saved, using a conditional update. - Hide the tools from service tokens, which carry a user id but no email. - Only mention get_canvas to the sub-agent when the client can call it. - Validate edited names, take the display name from the YAML on edits, and require project_id and yaml in the request. - Reword the MCP error for an unavailable develop_personal_canvas, and document the tool.
…ool is available Conditional updates of virtual files now apply the same 128kb limit as inserts. The docs say the tool is Rill Cloud only, and the MCP error mentions service tokens.
The agent couldn't find the name of a personal canvas to edit from a new conversation: it was given the display name, develop_personal_canvas returned not found and the agent created a duplicate dashboard instead. list_canvases lists the canvases the user can see, including their own personal canvases marked with personal: true. Other users' personal canvases are never listed, even for project admins who can open them.
Move the prompt to a userPrompt method and split it into important and additional context, as develop_file does. Add the user's memories, so preferences stated to the analyst also apply to the dashboards it builds.
…oard-from-chat # Conflicts: # proto/gen/rill/admin/v1/api.pb.go
…oard-from-chat # Conflicts: # proto/gen/rill/admin/v1/api.pb.go # runtime/drivers/admin.go # runtime/testruntime/noopadmin.go # runtime/testruntime/testruntime.go
A dashboard the AI saved from the chat did not show in the personal dashboards list until a full reload: nothing refetched the admin's ListPersonalFiles, and queries don't refetch on mount or focus, so going back to the page reused the cached list too. - The chat tool registry's onResult for develop_personal_canvas, the hook update_memory uses, refetches the runtime resources and emits personal-files-changed on the event bus. web-admin owns the admin query, so a listener mounted by the project layout refetches ListPersonalFiles on it. Both use refetchType "all": an invalidated query nobody observes is not refetched when it mounts again. - getPersonalFilteredResources refetches both lists on mount, as the alerts and reports lists do, so a dashboard saved away from the page (e.g. over MCP) shows up when coming back.
…oard-from-chat # Conflicts: # admin/server/mcp.go # proto/gen/rill/admin/v1/api.pb.go # runtime/ai/ai.go
…aved on behalf of a user The sanitizer only dropped the top-level annotations, but the parser applies prod:, env: and environment_overrides: over them, so the model's YAML could still share a personal canvas, change its owner or turn off admin_managed. A name or namespace also registered the canvas under another name than its file's, which broke the returned link and later edits. Drop those keys too, and test the sanitized YAML through the parser as a primary deployment parses it.
…YAML Alerts and reports created through the API with a resolver serialized its properties as the protobuf Struct's internals (fields/kind/stringvalue), so the runtime parsed different properties than it was given.
An alert with the ai resolver has its prompt judged as a condition by the analyst agent, which ends with a structured verdict. A met condition returns one row with the verdict's reason and the conversation, so the alert fires; a malformed verdict or an exhausted tool budget is an evaluation error. The check runs with the alert's own claims, and notifications show the reason and link to the conversation.
The data tab switches between criteria and an AI condition written as a sentence. AI alerts load into and save from the dialog however they were created, and the alert page and history show the condition and the reason an AI alert triggered.
Adds SaveAlertForUser, ListAlertsForUser, SaveReportForUser and ListReportsForUser, and exposes them to the runtime through the admin service driver. They let the runtime create and edit alerts and reports for the user of its session, as the alert and report dialogs do. Only the project's primary deployment can call them, and only for a user with access to the project. They write the same managed YAML as CreateAlert and CreateReport, owned by that user, and only edit alerts and reports the user owns. An edit is based on the version a list returned, and fails if the file changed since, so it doesn't overwrite a change made from the dialog in the meantime. A report that opens with each recipient's own permissions is rejected if a recipient or option needs the creator's, with an error that explains the alternative.
…dialog The dialog waited for the dashboard state decoded from web_open_state before editing any alert but an AI one. An alert created through the API may have no web_open_state, so such a formula alert never opened. Editing builds its values, filters and time controls from the alert's spec alone, so only creating waits for the dashboard state now.
A comparison of a rill time expression is saved as the expression with the option's offset, like "offset -1M" for the previous month. Reading it back had no branch for expressions, so the alert and report dialogs showed every such comparison as the previous period, and opening an alert or report on its dashboard did the same. It now takes the option from the trailing offset; any other expression reads as before.
The alert page labelled a comparison saved as a rill time expression, like "offset -1M", as the previous period: getComparisonLabel took a range with neither ISO offset nor duration for one. The criteria named the comparison from the ISO offset only, falling back to an untranslated "previous period". Both now read the comparison option from the expression's offset, as the dialog's mappers do, and the criteria fall back to the translated previous period.
Adds the save_alert and list_alerts tools to the analyst. They save alerts through the admin service on behalf of the session's user, as the alert dialog saves them: a formula alert over the dialog's MetricsViewAggregation query, or an AI alert judged by the ai resolver. The user owns them and can keep editing them in the dialog. An edit starts from the alert as listed and only changes the arguments it sends, so settings the arguments can't express, like the dashboards' measure filters or a time range saved as an ISO duration, are kept. It's based on the version the list returned, and fails if the alert changed since. The tools are only offered to users present to confirm what they save, in prod deployments: not to service tokens, nor to the sessions of AI reports and alerts.
…ols over MCP Requests to create or change an alert go to the analyst, which saves an alert the user owns, unless the user asks for a file in the project. The org-level MCP server forwards save_alert and list_alerts, which don't need runtime.EditRepo since the alerts they save aren't stored in the repo.
|
The same direction as #10122 applies here: create and delete only, with a slim list, and no editing from the chat for now. All three report kinds are fine to keep. Create and delete only.
AI reports cannot be edited anywhere. The report dialog does not build AI reports, and Canvas reports. Smaller points.
Developed in collaboration with Claude Code |
Hey @nishantmonu51 @k-anshul,
Last of four stacked PRs, on top of #10122. Draft, to ask for your opinion. Only the commits after #10122's are new here.
The same as #10122, for scheduled reports: "send me the sales by region every Monday at 9" in the chat. Feel free to modify, adapt or discard it, or suggest changes.
save_reportcreates a report for the user, or edits one of their own, of the three kinds the dialog makes: an explore data export (measures, dimensions, filters, time range, CSV, XLSX or Parquet, limit, header and attachment), a canvas PDF (filters per metrics view, tabs, whether it shows the filters), or an AI report (prompt, data context, comparison period). It writes what the report dialog writes, so the report opens and edits there.open_mode. Whether the report opens with each recipient's permissions (the default) or the creator's, as in the dialog.list_reportslists the user's own reports with their definition insave_report's arguments.Things we were not sure about
admin/server/reports.goand here. We kept a small local map instead of moving the others, to not touch more code. Happy to share one helper if you prefer.Happy to rename things or rework it, and just as happy to keep it on our side if you don't want it.
Developed in collaboration with Claude Code